<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/base/common.jsp" %>
<%@ taglib uri="/struts-tags" prefix="s" %> 
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新闻管理</title>
<link rel="stylesheet" href="${root }/css/public.css"/>
<script type="text/javascript" src="${root }/js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="${root }/js/module/common/common.js"></script>
<script type="text/javascript" src="${root }/js/module/newsinfo/newsinfo.js"></script>
<script type="text/javascript" src="${root }/js/win_layer/win_layer.js"></script>
<script type="text/javascript" src="${root }/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    document.onkeydown=keyDownQuery; 
</script>
</head>
<body>
    <!--right-->
        <!--right-->
        <h3 class="right_nav">新闻中心 >> 新闻管理</h3>
        <ul class="inquire">
        <s:form id="queryNewsInfoAction" method="POST">
          <input type="hidden" id="pageNo" name="pageNo" value="<s:property value="page.currentPage"/>"/>
            <li style="height:22px;">
              <label>新闻类型：</label>
                    <s:select id="newsType" list="#{1:'站内公告',2:'理财课堂',3:'头条新闻'}" listKey="key" listValue="value"  
                    headerKey="" headerValue="--请选择--"	 name="queryParamVo.newsType"></s:select>
            </li>
            <li style="height:22px;">
              <label>是否推荐：</label>
                <s:select style="width:80px;"
                        list="#{1:'是',0:'否'}" id="recommend"
                        name="queryParamVo.recommend" listKey="key" listValue="value" headerKey=""  headerValue="--请选择--"
                        ></s:select>
            </li>
            <li style="height:22px;"> <label>所属平台：</label>
            <s:select  list="list"  id="platformId" name="queryParamVo.platformId"  listKey="plateformId" listValue="plateformName"  headerKey="" headerValue="--请选择--"></s:select>
            </li>
            <li style="height:22px;"><label>发布时间：</label><input id="lowTime" value="<s:property value="queryParamVo.lowTime"/>"  name="queryParamVo.lowTime" type="text" class="Wdate input" onclick="WdatePicker();"><span class="line_h" >-</span><input id="topTime" value="<s:property value="queryParamVo.topTime"/>" name="queryParamVo.topTime" type="text" class="Wdate input" onclick="WdatePicker();"></li>
            <li style="width:30px;"><a href="javascript:queryNewsInfo();" class="btn1" >查询</a>
            <li style="width:30px;"><a href="javascript:toAddNewsInfo();" class="btn2" >添加</a>
            <!-- <li style="width:30px;"><a href="javascript:publishNewsInfo();" class="btn2" >发布</a> -->
            <li style="width:30px;"><a href="javascript:toEditNewsInfo();" class="btn3" >修改</a>
            <li style="width:30px;"><a href="javascript:deleteNewsInfo();" class="btn4" >删除</a>
        </s:form>
        </ul>
       
                <div class="table_bg" style="overflow-x:auto; max-width:1600px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                        <thead>
                              <tr height="44" bgcolor="#edeef5">
                                <td width="5%" style="text-indent:6px;"><input
                               type="checkbox" id="allcheckbox" class="v" onclick="allcheckboxchange()"><label
                                class="v">全选</label></td>
                                <td nowrap width="5%" align="center">新闻类型</td>
                                <td nowrap width="25%" align="center">新闻名称</td>
                                <td nowrap width="8%" align="center">所属平台</td>
                                <td nowrap width="5%" align="center">浏览次数</td>
                                <td nowrap width="5%" align="center">被赞次数</td>
                                <td nowrap width="5%" align="center">是否推荐</td>
                                <td nowrap width="5%" align="center">是否发布</td>
                                <td nowrap width="5%" align="center">评论</td>
                                <td nowrap width="15%" align="center">创建时间</td>
                                <th nowrap width="15%" align="center">操作</th>
                              </tr>
                        </thead>
                        <tbody>
                        <s:if test="page.totalSize > 0">
                           <s:iterator value="page.resultList" var="item">
                          <tr height="40">
                            <td width="5%" style="text-indent:6px;"><input
                                    class="checkbox" type="checkbox" name="newsIds"
                                    id="<s:property value="#item.newsId" />" /></td>
                            <td nowrap align="center" >
                            <s:if test="#item.type == 1">站内公告</s:if>
                            <s:elseif test="#item.type == 2">理财课堂</s:elseif>
                            <s:else>头条新闻</s:else>
                            &nbsp;
                            </td>
                            <td nowrap align="center">
                            <a href="#" title='<s:property value="#item.title"/>'>
                               <s:if test="#item.title.length()>11"><s:property value="#item.title.substring(0,10)+'...'" /></s:if>
                               <s:else><s:property value="#item.title"/></s:else></a>
                            <td nowrap align="center"><s:property value="#item.plateformName"/></td>
                            <td nowrap align="center"><s:property value="#item.browseNumber"/> &nbsp;</td>
                            <td nowrap align="center"><s:property value="#item.praise"/> &nbsp;</td>
                            <td nowrap align="center">
	                            <s:if test="#item.recommend == 1">是</s:if>
	                            <s:else>否</s:else>
	                             &nbsp;
                            </td>
                            <td nowrap align="center"> 
	                            <s:if test="#item.status == 1"><font color="green">是</font></s:if>
	                            <s:else><font color="#F00">否</font></s:else>
	                             &nbsp;
                            </td>
                            <td nowrap align="center"><s:property value="item.canDiscuss"/>
                            <s:if test="#item.canDiscuss == 1">允许被评论</s:if>
                            <s:elseif test="#item.canDiscuss == 0">不允许被评论</s:elseif>
                             &nbsp;</td>
                           <td nowrap align="center"><s:date name="#item.createTime" format="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>
                           
                           <td align="center">
			              	 <s:if test="%{#item.status == 0}">
								<a href="javascript:void(0);" title="发布" class="modify" onclick="publishNewsInfo(<s:property value="#item.newsId" />)">发布</a>
							 </s:if> 
							 <s:else>
								<a href="javascript:void(0);" title="取消发布" class="modify" onclick="cancelPublishNewsInfo(<s:property value="#item.newsId" />)">取消发布</a>
							 </s:else>
							 <s:if test="%{#item.recommend == 0}">
								<a href="javascript:void(0);" title="推荐" class="modify" onclick="recommendNewsInfo(<s:property value="#item.newsId" />)">推荐</a>
							 </s:if> 
							 <s:else>
								<a href="javascript:void(0);" title="取消推荐" class="modify" onclick="cancelRecommendNewsInfo(<s:property value="#item.newsId" />)">取消推荐</a>
							 </s:else>
			              </td>
                          </tr>
                           </s:iterator>
                        </s:if>
                        <s:else>
                            <tr>
                                <td height="40" align="center"  colspan="15">没有数据!</td>
                            </tr>
                        </s:else>
                        </tbody>
                      </table>      
                 </div>
        <jsp:include page="/WEB-INF/base/page.jsp"/>  
  <!--/right-->
</body>
</html>
